import React, { Component } from 'react';
import { Row, Col, Card } from 'antd';

import Item from '../../components/task/Item';
import AddItem from '../../components/task/AddItem';

class Task extends Component {
  constructor(props) {
    super(props);
    this.state = {
      isAdd: false,
      taskList: []
    }
  }

  setStateHandle = (value) => {
    this.setState(value);
  }

  render() {
    return (
      <Row>
        <Col span={8} offset={8}>
          <Card title="Default size card" style={{ width: 300 }}>
            {this.state.taskList.map((item, key) => {
              return (<Item key={key} />);
            })}
            <AddItem
              state={this.state}
              setStateHandle={this.setStateHandle}
            />
          </Card>
        </Col>
      </Row>
    );
  }
}

export default Task;
